package com.hospital.vac.controller;

import com.hospital.vac.common.Result;
import com.hospital.vac.entity.Area;
import com.hospital.vac.mapper.AreaMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author ANLGIN
 * @description 地区控制层
 * @return
 * @since 2023/3/9 16:27
 */

@RestController
@RequestMapping("/area")
public class AreaController {

    @Resource
    private AreaMapper areaMapper;

    /**
     * @return com.hospital.vac.common.Result<?>
     * @description 查询所有地区信息
     * @author ANLGIN
     * @since 2023/3/9 16:29
     */

    @GetMapping
    public Result<?> findAll() {
        List<Area> areas = areaMapper.selectList(null);
        return Result.success(areas);
    }


}
